#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;

#define MAX_N 200000
char charset[MAX_N + 5];
int n;

long long find(int x)
{
    if (x <= 0)
        return 0;
    long long ret = 0;
    int hash[26];
    memset(hash, 0, sizeof(hash));
    int variety = 0;
    // cout << "x的大小： " << x << endl;
    // cout << "n的大小： " << n << endl;
    for (int left = 0, right = 0; right < n; right++)
    {
        // 进窗口
        if (hash[charset[right] - 'a'] == 0)
            variety += 1;
        hash[charset[right] - 'a'] += 1;
        // cout << "进窗口" << charset[right] << endl;
        // 出窗口
        while (variety > x)
        {
            hash[charset[left] - 'a'] -= 1;
            if (hash[charset[left] - 'a'] == 0)
                variety -= 1;
            left += 1;
            // cout << "出窗口" << charset[left - 1] << endl;
        }
        // 统计方案
        ret += right - left + 1;
        // cout << "left: " << left << " right: " << right << endl;
        // cout << "第" << right + 1 << "次滑动窗口的方案数量：" << right - left + 1 << endl;
    }
    // cout << "当前的方案数量：" << ret << endl;
    return ret;
}

int main()
{
    int l, r;
    cin >> n >> l >> r;
    cin >> charset;
    cout << find(r) - find(l - 1) << endl;
    return 0;
}